package com.ruoyi.cuser.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.cuser.doman.LoginForm;
import com.ruoyi.cuser.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: 弔人
 * @time: 2022/11/7 9:27
 */
@RestController
@RequestMapping("/cuser")
public class UserController {
    @Autowired
    private UserService userService;


    @PostMapping("/test")
    public String test(@RequestBody LoginForm loginForm){
        return loginForm.getLoginName();
    }



    @PostMapping("/login")
    public AjaxResult login(@RequestBody LoginForm loginForm){
        return userService.login(loginForm);
    }
}
